package com.ikas.autumn.iec104.module.iec;

import lombok.extern.slf4j.Slf4j;
import org.openmuc.j60870.ASdu;
import org.openmuc.j60870.ConnectionEventListener;

import java.io.IOException;

@Slf4j
public class J60870ClientListener implements ConnectionEventListener{

	/**监听从站发来的数据*/
	@Override
	public void newASdu(ASdu aSdu) {
		//打印数据，效果见下图
		log.info(aSdu.toString());
	}

	/**监听连接关闭*/
	@Override
	public void connectionClosed(IOException cause) {
		cause.printStackTrace();
	}
}
